We have collected data from a quasi experimental study of medical students which was conducted in 2019. At that time nobody was familiar with the various meeting platforms like zoom or teams. Let us import the data to r :
We can see that classStudyRaw is a data.table with a dimension of 49 x 18. There are 49 rows, curresponding 49 students and 18 variable columns. It include an identifier for each student. The type of class is in the “character” class, which we want as “factor”, because it should be the grouping variable. Likert score of 1 to 10 could be the score for each question and the researcher might have considered it as pseudo-interval scale to get a total likert score, likert.total. So we may ignore the individual questions from the analysis for the time being. Similarly we may remove pretest and post test ranks from analysis, because what we are interested in is the score.
So the final data table can be sub-setted in to 6 columns and type.class should be converted to factor.
We have several options to summarise data in r. The base pack comes with summary() package
summary(classStudy)
idertifier type.class pretest.score posttest.score
Length:49 physical:24 Min. : 0.00 Min. : 50.00
Class :character virtual :25 1st Qu.:20.00 1st Qu.: 75.00
Mode :character Median :40.00 Median : 80.00
Mean :41.63 Mean : 78.06
3rd Qu.:60.00 3rd Qu.: 85.00
Max. :80.00 Max. :100.00
sex likert.total
Min. :1.000 Min. :3.100
1st Qu.:1.000 1st Qu.:3.500
Median :2.000 Median :3.700
Mean :1.633 Mean :3.665
3rd Qu.:2.000 3rd Qu.:3.800
Max. :2.000 Max. :4.100
We can see that sex is another grouping variable and the labels are not given for 1 and 2. We can give male and female labels to 1 and 2 using levels() function, of course, after converting sex in to factors.
[1] male male female female male male female female female female
[11] male male male female female female female female male female
[21] female male female female female male female female female female
[31] male female female male female male female male female female
[41] female male female female male female female male male
Levels: male female
Lets summarise again
summary(classStudy)
idertifier type.class pretest.score posttest.score sex
Length:49 physical:24 Min. : 0.00 Min. : 50.00 male :18
Class :character virtual :25 1st Qu.:20.00 1st Qu.: 75.00 female:31
Mode :character Median :40.00 Median : 80.00
Mean :41.63 Mean : 78.06
3rd Qu.:60.00 3rd Qu.: 85.00
Max. :80.00 Max. :100.00
likert.total
Min. :3.100
1st Qu.:3.500
Median :3.700
Mean :3.665
3rd Qu.:3.800
Max. :4.100
classStudy$type.class: physical
classStudy$sex: male
idertifier type.class pretest.score posttest.score sex
Length:9 physical:9 Min. : 0.00 Min. :50.00 male :9
Class :character virtual :0 1st Qu.:20.00 1st Qu.:75.00 female:0
Mode :character Median :40.00 Median :85.00
Mean :33.33 Mean :78.33
3rd Qu.:40.00 3rd Qu.:85.00
Max. :60.00 Max. :90.00
likert.total
Min. :3.700
1st Qu.:3.700
Median :3.800
Mean :3.856
3rd Qu.:4.000
Max. :4.100
------------------------------------------------------------
classStudy$type.class: virtual
classStudy$sex: male
idertifier type.class pretest.score posttest.score sex
Length:9 physical:0 Min. : 0.00 Min. : 55.00 male :9
Class :character virtual :9 1st Qu.:40.00 1st Qu.: 75.00 female:0
Mode :character Median :40.00 Median : 80.00
Mean :44.44 Mean : 81.11
3rd Qu.:60.00 3rd Qu.: 90.00
Max. :60.00 Max. :100.00
likert.total
Min. :3.200
1st Qu.:3.300
Median :3.500
Mean :3.444
3rd Qu.:3.500
Max. :3.800
------------------------------------------------------------
classStudy$type.class: physical
classStudy$sex: female
idertifier type.class pretest.score posttest.score sex
Length:15 physical:15 Min. : 0.00 Min. :60.00 male : 0
Class :character virtual : 0 1st Qu.:20.00 1st Qu.:75.00 female:15
Mode :character Median :40.00 Median :80.00
Mean :37.33 Mean :77.67
3rd Qu.:60.00 3rd Qu.:82.50
Max. :80.00 Max. :90.00
likert.total
Min. :3.60
1st Qu.:3.70
Median :3.80
Mean :3.82
3rd Qu.:3.90
Max. :4.10
------------------------------------------------------------
classStudy$type.class: virtual
classStudy$sex: female
idertifier type.class pretest.score posttest.score sex
Length:16 physical: 0 Min. :20.00 Min. :55.00 male : 0
Class :character virtual :16 1st Qu.:35.00 1st Qu.:68.75 female:16
Mode :character Median :50.00 Median :80.00
Mean :48.75 Mean :76.56
3rd Qu.:60.00 3rd Qu.:85.00
Max. :80.00 Max. :90.00
likert.total
Min. :3.100
1st Qu.:3.400
Median :3.500
Mean :3.538
3rd Qu.:3.700
Max. :4.000
classStudy$type.class classStudy$sex classStudy$likert.total
1 physical male 3.855556
2 virtual male 3.444444
3 physical female 3.820000
4 virtual female 3.537500
Graphing data
Post test score
hist(classStudy$posttest.score,breaks =10,main ="Hsitogram of Posttest Score of all students",xlab ="Post test score",ylab ="Number",col ="light blue")
Pre test score
hist(classStudy$pretest.score,breaks =5,main ="Hsitogram of Pretest Score of all students",xlab ="Pre test score",ylab ="Number",col ="light yellow")